Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4336: Return 400 error on invalid JSON sent to the datastore API #4341

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

janette
Copy link
Member

@janette janette commented Nov 15, 2024

Fixes #4336

Describe your changes

Better response for invalid JSON

QA Steps

  • Run the following POST
POST https://demo.getdkan.org/api/1/datastore/query/cedcd327-4e5d-43f9-8eb1-c11850fa7c55/0 HTTP/1.1

{
  "conditions": [
}
  • Confirm you get a 400 error and "Invalid JSON" message
  • Run the following POST
POST https://demo.getdkan.org/api/1/datastore/query/cedcd327-4e5d-43f9-8eb1-c11850fa7c55/0 HTTP/1.1

{
    "format": "csv
    "limit": 10
}
  • Confirm you get a 400 error and "Invalid JSON" message

Checklist before requesting review

If any of these are left unchecked, please provide an explanation

  • I have updated or added tests to cover my code
  • I have updated or added documentation

@janette janette marked this pull request as ready for review November 15, 2024 19:07
@dafeder dafeder marked this pull request as draft December 11, 2024 19:35
@kaise-lafrai kaise-lafrai force-pushed the catch-invalid-datastore-query branch from bbee644 to d9b0fb2 Compare January 14, 2025 19:28
@kaise-lafrai kaise-lafrai marked this pull request as ready for review January 14, 2025 19:29
@kaise-lafrai kaise-lafrai requested a review from paul-m January 14, 2025 19:30
@kaise-lafrai kaise-lafrai requested a review from paul-m January 14, 2025 20:32
@paul-m paul-m merged commit 4fbd597 into 2.x Jan 14, 2025
10 checks passed
@paul-m paul-m deleted the catch-invalid-datastore-query branch January 14, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid JSON causes datastore API to throw 500
3 participants